package cloud.shyidong.feign;

import cloud.shyidong.core.Result;
import cloud.shyidong.system.request.LoginRequest;
import cloud.shyidong.tenant.request.TenantLoginRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;

/**
 * @Description TODO
 * @Author syd
 * @Date 2023/10/19
 */
@FeignClient("cloud-auth")
public interface AuthServiceFeign {
    
    @PostMapping("/admin/login")
    public Result adminLogin(@RequestBody LoginRequest loginRequest);
    
    @GetMapping("/admin/get")
    public Result getAdminInfo(@RequestParam("token") String token);
    
    @PostMapping("/tenant/login")
    public Result tenantLogin(@RequestBody @Valid TenantLoginRequest tenantLoginRequest);
    
    @GetMapping("/tenant/get")
    public Result getTenantLoginInfo(@RequestParam("token") String token);
    
    
}
